package com.iscas.dataaggregation.domain.experiment;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @TableName otel_logs
 */
@TableName(value ="otel_logs")
@Data
public class OtelLogs implements Serializable {
    /**
     *
     */
    @TableField(value = "`Timestamp`")
    private Date timestamp;

    /**
     *
     */
    @TableField(value = "`TraceId`")
    private Object traceid;

    /**
     *
     */
    @TableField(value = "`SpanId`")
    private Object spanid;

    /**
     *
     */
    @TableField(value = "`TraceFlags`")
    private Integer traceflags;

    /**
     *
     */
    @TableField(value = "`SeverityText`")
    private Object severitytext;

    /**
     *
     */
    @TableField(value = "`SeverityNumber`")
    private Integer severitynumber;

    /**
     *
     */
    @TableField(value = "`ServiceName`")
    private Object servicename;

    /**
     *
     */
    @TableField(value = "`Body`")
    private Object body;

    /**
     *
     */
    @TableField(value = "`ResourceAttributes`")
    private Object resourceattributes;

    /**
     *
     */
    @TableField(value = "`LogAttributes`")
    private Object logattributes;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OtelLogs other = (OtelLogs) that;
        return (this.getTimestamp() == null ? other.getTimestamp() == null : this.getTimestamp().equals(other.getTimestamp()))
                && (this.getTraceid() == null ? other.getTraceid() == null : this.getTraceid().equals(other.getTraceid()))
                && (this.getSpanid() == null ? other.getSpanid() == null : this.getSpanid().equals(other.getSpanid()))
                && (this.getTraceflags() == null ? other.getTraceflags() == null : this.getTraceflags().equals(other.getTraceflags()))
                && (this.getSeveritytext() == null ? other.getSeveritytext() == null : this.getSeveritytext().equals(other.getSeveritytext()))
                && (this.getSeveritynumber() == null ? other.getSeveritynumber() == null : this.getSeveritynumber().equals(other.getSeveritynumber()))
                && (this.getServicename() == null ? other.getServicename() == null : this.getServicename().equals(other.getServicename()))
                && (this.getBody() == null ? other.getBody() == null : this.getBody().equals(other.getBody()))
                && (this.getResourceattributes() == null ? other.getResourceattributes() == null : this.getResourceattributes().equals(other.getResourceattributes()))
                && (this.getLogattributes() == null ? other.getLogattributes() == null : this.getLogattributes().equals(other.getLogattributes()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode());
        result = prime * result + ((getTraceid() == null) ? 0 : getTraceid().hashCode());
        result = prime * result + ((getSpanid() == null) ? 0 : getSpanid().hashCode());
        result = prime * result + ((getTraceflags() == null) ? 0 : getTraceflags().hashCode());
        result = prime * result + ((getSeveritytext() == null) ? 0 : getSeveritytext().hashCode());
        result = prime * result + ((getSeveritynumber() == null) ? 0 : getSeveritynumber().hashCode());
        result = prime * result + ((getServicename() == null) ? 0 : getServicename().hashCode());
        result = prime * result + ((getBody() == null) ? 0 : getBody().hashCode());
        result = prime * result + ((getResourceattributes() == null) ? 0 : getResourceattributes().hashCode());
        result = prime * result + ((getLogattributes() == null) ? 0 : getLogattributes().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", timestamp=").append(timestamp);
        sb.append(", traceid=").append(traceid);
        sb.append(", spanid=").append(spanid);
        sb.append(", traceflags=").append(traceflags);
        sb.append(", severitytext=").append(severitytext);
        sb.append(", severitynumber=").append(severitynumber);
        sb.append(", servicename=").append(servicename);
        sb.append(", body=").append(body);
        sb.append(", resourceattributes=").append(resourceattributes);
        sb.append(", logattributes=").append(logattributes);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}